package com.example.demos;

import com.example.demos.service.H2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class DemosApplication {

    public DemosApplication(H2Service h2Service) {
        this.h2Service = h2Service;
    }

    public static void main(String[] args) {
        SpringApplication.run(DemosApplication.class, args);
    }

    private final H2Service h2Service;

    @GetMapping("/test")
    public String test() {
        h2Service.addUser();
        return "SUCCESS";
    }

}
